﻿using AiQiuQuan.Sport.Model.Models;
using AiQiuQuan.Sport.WebApi.Services;
using DotNetCore.CAP;

namespace AiQiuQuan.Sport.WebApi.SubscribeServices.Impl
{
    /// <summary>
    /// 场馆账户订阅服务
    /// </summary>
    public class VenueAccountSubscribeService : ICapSubscribe, IVenueAccountSubscribeService
    {
        private readonly IVenueInfoAccountService _venueInfoAccountService;

        /// <summary>
        /// ctor
        /// </summary>
        public VenueAccountSubscribeService(
            IVenueInfoAccountService venueInfoAccountService)
        {
            _venueInfoAccountService = venueInfoAccountService;
        }

        /// <summary>
        /// 明细记录新增
        /// </summary>
        [CapSubscribe(MessageTopic.VENUE_ACCOUNT_DETAIL_ADD)]
        public async Task AddRecordAsync(List<VenueInfoAccountDetailAddDto> modelList)
        {
            await _venueInfoAccountService.AddDetailListAsync(modelList);
        }
    }
}
